﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:p="clr-namespace:Lithnet.Acma.Presentation"
                    xmlns:a="clr-namespace:Lithnet.Acma;assembly=Lithnet.Acma"
                    xmlns:c="clr-namespace:Lithnet.MetadirectoryServices;assembly=Lithnet.MetadirectoryServices"
                    xmlns:fim="clr-namespace:Microsoft.MetadirectoryServices;assembly=Microsoft.MetadirectoryServicesEx"
                    xmlns:core="clr-namespace:Lithnet.Common.Presentation;assembly=Lithnet.Common.Presentation">

    <DataTemplate  DataType="{x:Type p:EventRuleViewModel}">
        <StackPanel>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <Label Content="Event Name"
                       Grid.Row="0"
                       Grid.Column="0"
                       Margin="2" />
                <TextBox Text="{Binding EventName, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                         Grid.Row="0"
                         Grid.Column="1"
                         Margin="2" />

                <Label Content="Sender"
                       Grid.Row="1"
                       Grid.Column="0"
                       Margin="2" />

                <RadioButton Content="Any sender"
                             IsChecked="{Binding AnySender}"
                             Grid.Row="1"
                             Grid.Column="1"
                             Margin="2" />

                <RadioButton Content="Specific sender"
                             IsChecked="{Binding SpecificSender}"
                             Grid.Row="2"
                             Grid.Column="1"
                             Margin="2" />

                <ComboBox ItemsSource="{Binding AllowedEventSources}"
                          SelectedItem="{Binding EventSource, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                          DisplayMemberPath="Name"
                          Grid.Row="3"
                          Grid.Column="1"
                          IsEnabled="{Binding SpecificSender}"
                          Margin="2"
                          IsEditable="True"/>
            </Grid>
        </StackPanel>
    </DataTemplate>
    
</ResourceDictionary>